import { check } from '@/utils/auth'

function install(app, options = {name: 'auth'}) {
  app.directive(options.name, {
    mounted(el, binding) {
      if (!check(binding.value)) {
        el.parentNode && el.parentNode.removeChild(el)
      }
    }
  })
}

export default { install }